package com.heaboy.feedback.service.impl;

import java.util.List;

import com.heaboy.feedback.domain.vo.TeacherInfoVO;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.heaboy.feedback.mapper.CourseTeacherMapper;
import com.heaboy.feedback.domain.CourseTeacher;
import com.heaboy.feedback.service.ICourseTeacherService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
 * 课程老师关联Service业务层处理
 * 
 * @author heaboy
 * @date 2024-02-01
 */
@Service
public class CourseTeacherServiceImpl extends ServiceImpl<CourseTeacherMapper, CourseTeacher> implements ICourseTeacherService
{
    @Autowired
    private CourseTeacherMapper courseTeacherMapper;

//    private I

    /**
     * 查询课程老师关联
     * 
     * @param id 课程老师关联主键
     * @return 课程老师关联
     */
    @Override
    public CourseTeacher selectCourseTeacherById(Long id)
    {
        return courseTeacherMapper.selectCourseTeacherById(id);
    }

    /**
     * 查询课程老师关联列表
     * 
     * @param courseTeacher 课程老师关联
     * @return 课程老师关联
     */
    @Override
    public List<CourseTeacher> selectCourseTeacherList(CourseTeacher courseTeacher)
    {
        return courseTeacherMapper.selectCourseTeacherList(courseTeacher);
    }

    /**
     * 新增课程老师关联
     * 
     * @param courseTeacher 课程老师关联
     * @return 结果
     */
    @Override
    public int insertCourseTeacher(CourseTeacher courseTeacher)
    {
        courseTeacher.setCreateTime(DateUtils.getNowDate());
        return courseTeacherMapper.insertCourseTeacher(courseTeacher);
    }

    /**
     * 修改课程老师关联
     * 
     * @param courseTeacher 课程老师关联
     * @return 结果
     */
    @Override
    public int updateCourseTeacher(CourseTeacher courseTeacher)
    {
        courseTeacher.setUpdateTime(DateUtils.getNowDate());
        return courseTeacherMapper.updateCourseTeacher(courseTeacher);
    }

    /**
     * 批量删除课程老师关联
     * 
     * @param ids 需要删除的课程老师关联主键
     * @return 结果
     */
    @Override
    public int deleteCourseTeacherByIds(Long[] ids)
    {
        return courseTeacherMapper.deleteCourseTeacherByIds(ids);
    }

    /**
     * 删除课程老师关联信息
     * 
     * @param id 课程老师关联主键
     * @return 结果
     */
    @Override
    public int deleteCourseTeacherById(Long id)
    {
        return courseTeacherMapper.deleteCourseTeacherById(id);
    }

    @Override
    public TeacherInfoVO listTeacherInfo() {
        Long userId = SecurityUtils.getUserId();
        List<CourseTeacher> courseTeachers = baseMapper.selectCourseTeacherList(new CourseTeacher().setTeacherId(userId));
        return null;
    }
}
